package dao;

import model.User;

import java.sql.SQLException;
import java.util.ArrayList;

public interface  UserDao {
    public int getUserCount() throws SQLException;
    // 根据用户id查询用户
    User getUserByID(int id) throws SQLException;

    User getUserByName(String username) throws SQLException;

    // 查询所有用户
    ArrayList<User> getAllUser(int pageIndex,int pageSize) throws SQLException;

    // 添加用户
    int addUser(User user);

    // 编辑用户信息
    int updateUser(User user);

    // 根据id删除用户
    int deleteUser(int id);

    ArrayList<User> searchUser(String keyword, int pageIndex, int pageSize) throws SQLException;

    // 计算搜索结果的数量
    int countSearchUser(String keyword) throws SQLException;
}
